<?
include_once "_common.php";
include_once("config.php"); 

// 장바구니가 비어있는가?
$tmp_on_uid = get_session('ss_on_uid');
if (get_cart_count($tmp_on_uid) == 0) 
    alert("장바구니가 비어 있습니다.", "./cart.php");

// 포인트 결제 대기 필드 추가
//sql_query(" ALTER TABLE `$g4[yc4_order_table]` ADD `od_temp_point` INT NOT NULL AFTER `od_temp_card` ", false);

$g4[title] = "주문서 작성";

$s_page = 'orderform.php';
$s_on_uid = $tmp_on_uid;

include($shop['include_head']);

include_once("./cartsub.inc.php");


//************************************************************
//
// 스킨명 : 카멜레온 간이몰 스킨
// 버  젼 : 2006-03-16일짜 버젼
// 제작자 : ⓒⓒⓒ (Soonho Choi) http://cm-builder.com
// MSN    : oldccc@oldccc.com
// 
// 저작권 : 이 주석 부분을 훼손하지 상태에서 수정및 사용이 자유롭습니다.
//
//************************************************************
//
// 스킨명 : 간이몰 스킨 1v
// 수  정 : 2006-07-29일
// 수정자 : 스펙트럼 (toptalent) http://spectrum-enter.com/YBH/
// E-mail : top-talent@hanmail.net
// 
// 저작권 : 이 주석 부분을 훼손하지않은 상태에서 수정및 사용이 자유롭습니다.
//
//************************************************************

$view = get_view($write, $board, $board_skin_path);

$icon_new = $icon_good = $icon_hit = $icon_point = $icon_aa = $icon_sellout ="";

if($view[wr_type1]) $icon_new = "<img src='$board_skin_path/img/icon_new.gif' align=absmiddle>";
if($view[wr_type2]) $icon_good = "<img src='$board_skin_path/img/icon_good.gif' align=absmiddle>";
if($view[wr_type3]) $icon_hit = "<img src='$board_skin_path/img/icon_hit.gif' align=absmiddle>";
if($view[wr_type4]) $icon_point = "<img src='$board_skin_path/img/icon_point.gif' align=absmiddle>";
if($view[wr_type5]) $icon_aa = "<img src='$board_skin_path/img/icon_24_02.gif' align=absmiddle>";

if($view[wr_type6]) $icon_sellout = "<img src='$board_skin_path/img/icon_sellout.gif' align=absmiddle>";
?>


<!-- 게시글 보기 시작 -->
<table width='98%' align="center" cellpadding="0" cellspcing="0"><tr><td>


<? if($is_admin =='super') { ?>
<table width='100%' cellpadding=0 cellspacing=0>
<tr height=35>
    <td width=75%>
        <? echo "<a href=\"$g4[bbs_path]/board.php?bo_table=$bo_table\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
    </td>
    <td width=25% align=right>
    </td>
</tr>
</table>
<? } ?>

<!----<table cellpadding=0 cellspacing=0 border=0>
<tr><td><img src="<?=$board_skin_path?>/img/view_01.gif" width=655 height="5"></td>
</tr>
<tr><td height=25 background="<?=$board_skin_path?>/img/view_02.gif" width=654></td></tr>
<tr><td background="<?=$board_skin_path?>/img/view_02.gif" align=center>---->



<!--  pro spec list -->
<table cellpadding=0 cellspacing=0 border=0 width=98%>
<form name=order method="POST" action="javascript:order_submit(document.order);" autocomplete="off">
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=wr_id value='<?=$wr_id?>'>
<input type=hidden name=od_price value='<?=$wr_price?>'>
<input type=hidden name=od_total_price value='<?=$tot_sell_amount?>'>                    
<input type=hidden name=od_qty value='<?=$wr_qty?>'>
<colgroup width=90>
<colgroup width=''>
<tr>
	<td colspan="2"><? include_once("./cartsub.inc.php"); ?></td>
</tr>
<tr><td colspan="2" height="10"></td></tr>
<tr>
	<td colspan="2" background="<?=$board_skin_path?>/img/bg_line.gif"><img src="<?=$board_skin_path?>/img/title5.gif"></td>
</tr>
<tr><td colspan="2" height="10"></td></tr>
<tr>
	<td class=write_head>받는분 성명</td>
	<td><input type=text name=od_name value='<?=$member[mb_name]?>' class=ed itemname="받는분 성함" required></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>

<? if(!$is_member) { //비회원일 경우 미밀번호 입력?>
<tr>
	<td class=write_head>비밀번호</td>
	<td align=left><input type=password name=passwd maxlength='10' value='' class=ed itemname="비밀번호" required> <font color='red'> 영,숫자 3~10자 (주문내역 조회시 필요)</font></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>

<tr>
	<td class=write_head>받는분 전화</td>
	<td><input type=text name=od_tel value='<?=$member[mb_tel]?>' class=ed itemname="받는분 연락처" required></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<tr>
	<td class=write_head>받는분 핸드폰</td>
	<td><input type=text name=od_hp value='<?=$member[mb_hp]?>' class=ed></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<tr>
	<td class=write_head>받는분 주소</td>
	<td><input type=text name=od_zip1 size=3 value='<?=$member[mb_zip1]?>' class=ed> - <input type=text name=od_zip2 size=3 value='<?=$member[mb_zip2]?>' class=ed>&nbsp;<a href="javascript:;" onclick="win_zip('order', 'od_zip1', 'od_zip2', 'od_addr1', 'od_addr2');"><img width="91" height="20" src="<?=$g4[path]?>/skin/member/basic/img/post_search_btn.gif" border=0 align=absmiddle></a>
	</td>
</tr>
<tr>
	<td class=write_head></td>
	<td><input type=text name=od_addr1 style='width:40%' value='<?=$member[mb_addr1]?>' class=ed itemname="주소" required> <input type=text name=od_addr2 style='width:40%' value='<?=$member[mb_addr2]?>' class=ed></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<tr><td colspan=2 height=30></td></tr>
<tr>
	<td colspan="2" background="<?=$board_skin_path?>/img/bg_line.gif"><img src="<?=$board_skin_path?>/img/title6.gif"></td>
</tr>
<tr><td colspan="2" height="10"></td></tr>
<tr>
	<td class=write_head>입금은행</td>
	<td>
	<select name='od_bank_use' class='ed'  itemname='입금은행' required>
	<option value='' >아래에서 거래은행을 선택하세요</option>
	<option value='국민 111-11-1111-111 홍길동' <? if($write[od_bank_use] == "국민 111-11-1111-111 홍길동") echo "selected"; ?>>국민 111-11-1111-111 홍길동</option>
	<option value='제일 111-11-1111-111 홍길동' <? if($write[od_bank_use] == "제일 111-11-1111-111 홍길동") echo "selected"; ?>>제일 111-11-1111-111 홍길동</option>
	</select></td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<tr>
	<td class=write_head>입금자명</td>
	<td><input type=text name=od_bank_mb_name value='' class=ed itemname="입금자" required></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<tr>
	<td class=write_head>입금날짜</td>
	<td><input type=text name=od_bank_date value='' class=ed itemname="입금날짜" readonly> <a href="javascript:win_calendar('od_bank_date', document.getElementById('od_bank_date').value, '');"><img src='<?=$g4[path]?>/skin/member/basic/img/calendar.gif' border=0 align=absmiddle title='달력 - 날짜를 선택하세요'></a></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<tr><td colspan=2 height=30></td></tr>
<tr>
	<td colspan="2" background="<?=$board_skin_path?>/img/bg_line.gif"><img src="<?=$board_skin_path?>/img/title7.gif"></td>
</tr>
<tr><td colspan="2" height="10"></td></tr>
<tr>
	<td class=write_head>기  타</td>
	<td><textarea name=od_memo rows="8" style='width=100%' class=ed></textarea></td>
</tr>
<tr><td height=20></td></tr>
<tr>
	<td height=20 colspan=2 align=center><input type=image src='<?=$board_skin_path?>/img/btn_order.gif'>&nbsp;<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$board_skin_path?>/img/btn_orlist.gif' border=0></a></td>
</tr>
</form>
</table>


</td></tr></table>


<script language="JavaScript">
    function resize_image() {
        var target = document.getElementsByName('target_resize_image[]');
        for(i=0; i<target.length; i++) { 
            target[i].tmp_width  = target[i].width;
            target[i].tmp_height = target[i].height;
        }
    }

    function order_submit(f)
    {
        f.action = "<?=$board_skin_path?>/order_u.php";
        f.submit();
    }

    window.onload = resize_image;
</script>


<?
include($shop['include_tail']);
?>
